#include "contacts.pb.h"
#include <iostream>


int main()
{
    contacts::contact conn;
    conn.set_name("zhangsan");
    conn.set_score(111);
    conn.set_sn(1);

    std::string str = conn.SerializeAsString();
    
    contacts::contact stu;
    bool ret = stu.ParseFromString(str);
    if (ret == false)
    {
        std::cout << "反序列化失败" << std::endl;
        exit(1);
    }

    std::cout << stu.sn() << std::endl;
    std::cout << stu.name() << std::endl;
    std::cout << stu.score() << std::endl;

    return 0;
}